﻿<?xml version="1.0" encoding="utf-8" ?>
<AdoNetDataAccess connection="$SyrinxDBConnection$" formatter="bizobj of TreeNode(counts); merged into node">

	<Sql>
		SELECT 
			id, parentId, parentHostId, c.objectId as counts_objectId, keyName, name as baseTitle,
			 treeName, totalL1 as counts_totalL1, totalL2 as counts_totalL2, dateCreated as counts_dateCreated, dateUpdated as counts_dateUpdated,
			 totalL3 as counts_totalL3, totalL4 as counts_totalL4, totalViews as counts_totalViews,
			 lastViewed as counts_lastViewed, lastChildUpdated as counts_lastChildUpdated,
			 lastChildUpdatedByUserId as counts_lastChildUpdatedBy_id
		FROM
			ObjectTreeNodes as t
			LEFT OUTER JOIN ObjectTreeCounts as c on c.objectId = t.objectId
		WHERE
			c.objectId = @id
	</Sql>
	<Param name="node.id" dbName="id" type="Guid"/>
</AdoNetDataAccess>
